package com.zyj.action;

import java.util.List;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import com.zyj.pojo.Asset;
import com.zyj.service.AssetService;
@Controller
@Results(value={
		@Result(name="index",location="index.jsp",type="dispatcher" ),
		
})
public class AssetAction extends BaseAction{

	private static final long serialVersionUID = 1L;
	private AssetService assetService;
	private List<Asset> assetList;
	private Asset asset;
	
	@Action("index")
	public String index(){
		System.out.println("ccccc");
		assetList = assetService.findAll();
		//asset = assetService.findById(2);
		
		System.out.println(assetList.size());
		return "index";
		
	}
	
	//get set
	@Autowired
	public void setAssetService(AssetService assetService) {
		this.assetService = assetService;
	}

	public List<Asset> getAssetList() {
		return assetList;
	}

	public void setAssetList(List<Asset> assetList) {
		this.assetList = assetList;
	}

	public Asset getAsset() {
		return asset;
	}

	public void setAsset(Asset asset) {
		this.asset = asset;
	}
}
